package com.collaboration.proton.services;


import com.collaboration.proton.dao.GameZoneRepository;
import com.collaboration.proton.entities.GameZone;
import com.collaboration.proton.entities.Player;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * @author thousandcat
 * @param
 * @return 无
 *
 */
@Service
public class GameZoneService {
    @Autowired
    GameZoneRepository gameZoneRepository;

    public List<GameZone> getAll(){
        return gameZoneRepository.findAll();
    }
    public GameZone save(GameZone gameZone){
        return gameZoneRepository.save(gameZone);
    }

    public List<GameZone> findAllByPlayers(Player player){
        return gameZoneRepository.findAllByPlayers(player);
    }

}
